[% setvar title Allow keywords in sub prototypes %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Allow keywords in sub prototypes</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Simon Cozens &lt;<a href='mailto:simon@brecon.co.uk'>simon@brecon.co.uk</a>&gt;
  Date: 25 Sep 2000
  Mailing List: <a href='mailto:perl6-language-subs@perl.org'>perl6-language-subs@perl.org</a>
  Number: 309
  Version: 1
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>This is a general way of helping people create their own syntax.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>The perlsub documentation talks about the use of <code>&amp;</code> in a prototype:</p>
<pre>    The interesting thing about C&lt;&amp;&gt; is that you can generate new syntax
    with it, provided it's in the initial position</pre>
<p>Well, you can, within limits. But it would fix a lot of things that
people believe they want if you could <b>really</b> define your own syntax.</p>
<pre>    sub apply (&amp; to @) {
        ...
    }

    apply { this } to @that;</pre>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>This becomes a <b>little</b> bit of a nightmare for the parser; but TeX
manages it.</p>
<p>In fact, it's not as hard as it looks, because you still know what
you're expecting: after a block, we want some whitespace and the
keyword &quot;to&quot;, then some more whitespace and an array. Since we may well
be having the parser dynamically modifiable, this should be easy. Yeah,
right.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>RFC 57: Subroutine prototypes and parameters</p>
<p><i><a href='http://search.cpan.org/perldoc?perlsub'>perlsub</a></i></p>
<p>RFC ??: Byte-compiled Parser</p>
<p>RFC ??:<code>use syntax</code></p>
</div>
